package com.tanhua.management.controller;



import com.tanhua.management.service.ManageService;
import com.tanhua.management.vo.ClientVo;
import com.tanhua.management.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/manage/users")
@RestController
public class ManageController {

    @Autowired
    private ManageService manageService;

    @GetMapping()
    public PageResult queryContactsList(@RequestParam(value = "page", defaultValue = "1") Integer page,
                                        @RequestParam(value = "pagesize", defaultValue = "10") Integer pageSize,
                                        @RequestParam(value = "id", required = false) String id,
                                        @RequestParam(value = "nickname", required = false) String nickname,
                                        @RequestParam(value = "city", required = false) String city) {

        return manageService.selectList(page,pageSize,id,nickname,city);

    }
    @GetMapping("{userID}")
    public ClientVo queryUserID(@PathVariable("userID")String userId){


        ClientVo clientVo =manageService.selectByuserID(userId);

        return clientVo;
    }
    @PostMapping("/freeze")
    public String freezeUser(@RequestBody String userId,Integer freezingTime,Integer freezingRange,
                             String reasonsForFreezing,String frozenRemarks) {

        return null;

    }

}
